import React,{ Component } from "react";
import { View,Text,StyleSheet } from "react-native";
import { Button } from "@ant-design/react-native";
import { remove as Storgae } from "../utils/StorageUtils";

export default class index extends Component{
    JumpOtherPage = ()=>{
      const { navigation } = this.props;
      navigation.navigate('OtherPage',{id:"接受到的id"});
    }
    LoggedOut = ()=>{
        const { navigation } = this.props;
        Storgae('userToken');
        navigation.navigate('Auth');
    }
    render(){
        return (
            <View style={styles.container}>
                <View>
                    <Text>首页</Text>
                    <Button onPress={()=>this.JumpOtherPage()}>
                        点击跳转其他页面
                    </Button>
                    <Button onPress={()=>this.LoggedOut()}>
                        退出登陆
                    </Button>
                </View>
            </View>
        )
    }
}

const styles = StyleSheet.create({
    container:{
        flex:1,
        justifyContent:'center',
        alignItems:'center',
    }
})
